import { request } from '@/http/axios';
import { IBase, IRecords } from '../app';

export interface IBookType extends IBase {
  id?: number;
  typeName: string;
}

function records(data) {
  return request<IRecords<IBookType>>({
    url: '/book/type/records',
    method: 'POST',
    data
  });
}

function upgrade(data) {
  return request({
    url: '/book/type/upgrade',
    method: 'POST',
    data
  });
}

function del(id) {
  return request({
    url: '/book/type/del',
    method: 'GET',
    params: {
      id
    }
  });
}

export const bookTypeModel = {
  records,
  upgrade,
  del
};
